package com.park.util;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;

import java.util.ArrayList;
import java.util.List;

public class ExcelListenerUtil<E> implements ReadListener<E>{


    public List<E> list=new ArrayList<>();
    /**
     * 读取到每一个对象都会调佣invoke方法
     * @param data
     * @param context
     */
    @Override
    public void invoke(E data, AnalysisContext context) {
        // TODO Auto-generated method stub
        System.out.println(data);
        list.add(data);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        // TODO Auto-generated method stub
        System.out.println("---读取完毕");
    }


}